put space & Space & peeklong(address,L) after field "data"
put last word of field "data" into address
end repeat
put return & return & "Click Mouse to Exit Demo" after field "data"
wait until the mouseclick
hide field "data"
end mouseUp
-- part contents for background part 68
----- text -----
Peeklong returns the unsigned 32-bit integer stored at a given address. This value is represented in hexadecimal, but you may use the HexToDec XFCN provided in this stack to convert the value to a decimal if you wish.
A typical useage of peeklong would be:
put peeklong("411000") into temp
On the Mac Plus, this would put the value 4CDF0007 into the variable temp.
As an option, you may include a second parameter with the Peeklong XFCN. If peeklong detects a second parameter, it returns a 2-line result that consists of the longinteger stored at the given address in the first line and the next viable address (the original address+8) in the second line. This option provides a simple and effective way to use peeklong in a script to peek into a range of addresses.
See the demo on this card for an example.
The address provided to peeklong must be even or an error will result.